<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>
<script>
import { constants } from './common/js/constants.js'
export default {
  name: 'app',
  /**
   * created 初始化判断是否登录
   * it.api.isLoggedIn():
   * 1.判断localStorage中是否有token,有就调api验证，无就未登录
   * 2.有token,但验证不通过，则为未登录并删除token
   */
  created() {
    let token = window.localStorage.getItem(constants.STORAGE_TOKEN_KEY)
    this.api.isLoggedIn(token)
  }
}

</script>
<style lang="scss" rel="stylesheet/scss">
#app {
  height: 100%;
}

</style>
